# Copyright 2005 BreakMyGentoo.net
# Distributed under the terms of the GNU General Public License v2

inherit eutils gnome2

DESCRIPTION="A graphical frontend for PostgreSQL"
HOMEPAGE="http://www.glom.org"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* ~x86 ~ppc ~amd64"
IUSE="doc"

RDEPEND="
	>=dev-cpp/bakery-2.4
	>=dev-cpp/gtkmm-2.6.1
	>=dev-cpp/gnome-vfsmm-2.11.1
	>=dev-cpp/libgtksourceviewmm-0.3
	>=dev-cpp/libgnomecanvasmm-2.10
	>=dev-libs/libxslt-1.1.10
	>=dev-python/pygtk-2.6
	>=gnome-base/libgnome-2.6
	>=dev-python/gnome-python-extras-2.14
	app-text/iso-codes
	>=dev-cpp/libgdamm-1.3.7
	dev-perl/XML-Parser
	dev-lang/perl
	dev-db/postgresql
	>=dev-lang/python-2.2"
	
DEPEND="${RDEPEND}
	dev-util/pkgconfig
	>=dev-util/intltool-0.35"

DOCS="AUTHORS ChangeLog HACKING NEWS README TODO"
USE_DESTDIR="1"

pkg_setup() {
	if built_with_use gnome-extra/libgda postgres
	then
		einfo "Postgres support enabled in gnome-extra/libgda - OK"
	else
		eerror "Please rebuild gnome-extra/libgda, with postgres support enabled!"
		eerror "Try USE=\"postgres\" emerge gnome-extra/libgda,"
		eerror "or add \"postgres\" to your USE string in /etc/make.conf and"
		eerror "emerge gnome-extra/libgda."
		die "USE flag \"postgres\" must be enabled in gnome-extra/libgda"
	fi

}

src_unpack() {
	unpack ${A}
	cd ${S}
	gnome2_omf_fix
}

src_compile() {
	gnome2_src_compile "--with-postgres-utils=/usr/bin"
}
